package cn.biplam.front.component.view.systemManage.sysprivi.user;

import cn.biplam.common.ajxcode.SystemCode.UserManageCode;
import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.front.component.AjxResponse;
import cn.biplam.front.component.view.systemManage.sysprivi.user.manage.UserManageMain;
import cn.biplam.front.component.view.systemManage.sysprivi.user.manage.add.UserBaseEdit;
import cn.biplam.front.component.view.systemManage.sysprivi.user.manage.del.DelUser;
import cn.biplam.front.component.view.systemManage.sysprivi.user.manage.list.UserBase;
import cn.biplam.front.component.view.systemManage.sysprivi.user.manage.navi.UserThemeList;
import cn.biplam.front.component.view.systemManage.sysprivi.user.manage.role.AddUserRole;
import cn.biplam.front.component.view.systemManage.sysprivi.user.manage.role.DelUserRole;
import cn.biplam.front.html.base.HtmlWindow;

/**
 * 用户管理
 * @author XiaoRuxing Nov 2, 20093:27:24 PM
 * @version 1.0
 */
public class UserManage extends AjxResponse{

	public static final String cId=UserManageCode.cId;
	
	/** 用户管理主界面*/
	public static final String Main= UserManageCode.Main;
	/** 显示用户和用户分类列表 */
	public static final String User_List = UserManageCode.User_List;
	
	/** 用户基本信息 */
	public static final String User_Base_Info = UserManageCode.User_Base_Info;
	
	/** 用户基本信息修改 */
	public static final String User_Base_Info_Edit = UserManageCode.User_Base_Info_Edit;
	/** 用户基本信息修改提交 */
	public static final String User_Base_Info_Edit_Submit = UserManageCode.User_Base_Info_Edit_Submit;
	
	/** 添加用户 */
	public static final String User_Add = UserManageCode.User_Add;
	/** 添加用户提交 */
	public static final String User_Add_Submit = UserManageCode.User_Add_Submit;
	
	
	/** 用户删除 */
	public static final String User_Del = UserManageCode.User_Del;
	/** 删除用户提交 */
	public static final String User_Del_Submit = UserManageCode.User_Del_Submit;
	
	/** 添加用户拥有角色页面 */
	public static final String User_Role_Add = UserManageCode.User_Role_Add;
	/** 添加用户拥有角色提交 */
	public static final String User_Role_Add_Submit = UserManageCode.User_Role_Add_Submit;
	/** 删除用户拥有角色页面 */
	public static final String User_Role_Del = UserManageCode.User_Role_Del;
	/** 删除用户拥有角色提交 */
	public static final String User_Role_Del_Submit = UserManageCode.User_Role_Del_Submit;

	/** 用户权限列表 */
	public static final String User_Privi_List = UserManageCode.User_Privi_List;
	
	@Override
	protected HtmlWindow ajxGet() throws ErrorMessage {
		if (this.actionId.equals(Main)){
			return new UserManageMain().get(mUser, sHomeUrl);			//主界面
		}else if (this.actionId.equals(User_List)){	
			return new UserThemeList(mUser,sHomeUrl,recordId,params).get();//用户列表界面
		}else if (this.actionId.equals(User_Base_Info)){	
			return new UserBase(mUser,sHomeUrl,recordId,params).get();//用户基本信息
		}else if (this.actionId.equals(User_Base_Info_Edit)){	
			return new UserBaseEdit(mUser,sHomeUrl,recordId,params).getEdit(containerId);//用户基本信息编辑
		}else if (this.actionId.equals(User_Base_Info_Edit_Submit)){	
			return new UserBaseEdit(mUser, sHomeUrl, recordId, params).editSubmit();//修改用户信息提交
		}else if (this.actionId.equals(User_Add)){	
			return new UserBaseEdit(mUser, sHomeUrl, recordId, params).getAdd();//添加用户界面
		}else if (this.actionId.equals(User_Add_Submit)){	
			return new UserBaseEdit(mUser, sHomeUrl, recordId, params).addSubmit();//添加用户提交
		}else if (this.actionId.equals(User_Del)){	
			return new DelUser(mUser, sHomeUrl, recordId, params).panel();//用户删除界面
		}else if (this.actionId.equals(User_Del_Submit)){	
			return new DelUser(mUser, sHomeUrl, recordId, params).submit();//删除用户提交界面
		
		//添加用户角色
		}else if (this.actionId.equals(User_Role_Add)){	
			return new AddUserRole(mUser, sHomeUrl, recordId, params).roleSelect();//添加用户角色界面
		}else if (this.actionId.equals(User_Role_Add_Submit)){	
			return new AddUserRole(mUser, sHomeUrl, recordId, params).submit();//添加用户角色提交
		
		//删除用户角色
		}else if (this.actionId.equals(User_Role_Del)){	
			return new DelUserRole(mUser, sHomeUrl, recordId, params).get();//删除用户角色界面
		}else if (this.actionId.equals(User_Role_Del_Submit)){	
			return new DelUserRole(mUser, sHomeUrl, recordId, params).submit();//删除用户角色提交
		
		}else if (this.actionId.equals(User_Privi_List)){	
			return new UserBase(mUser, sHomeUrl, recordId, params).getUserRolePriviList();//用户角色权限列表
		}else{
			throw new ErrorMessage("Ajx Exchange outport not found:" + actionId	+ " !");
		}
	}
	
}
